package com.vma.jifu.controller;


import com.vma.jifu.offer.service.OfferService;
import com.vma.jifu.offer.service.impl.OfferServiceImpl;

/**
 * Created by chenzui on 2017/6/22.
 */
public class OfferController extends BaseController {
    private OfferService offerService = new OfferServiceImpl();

    public void getOfferType(){
        renderRes(offerService.qryTypes());
    }

    public void getOffersByType(){
        Integer cPage = getParaToInt("cPage");
        Integer pSize = getParaToInt("pSize");
        Integer typeId = getParaToInt("typeId");
        renderRes(offerService.qryOfferByTypeId(cPage,pSize,typeId));
    }

    public void getOfferById(){
        Integer id = getParaToInt("id");
        Integer version = getParaToInt("version");
        renderRes(offerService.getOfferById(id,version));
    }
}
